import unittest
from time import sleep
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
import Login


class mytest01(unittest.TestCase):
    def setUp(self):
        self.driver =Login.login()
    def test_zhengxiang_01(self):
        self.driver.find_element('link text','文档管理').click()
        sleep(1)
        self.driver.find_element('link text','我的文档').click()
        sleep(1)
        ele1=self.driver.find_element('css selector','#iframe_main')   #进入新建文件层
        self.driver.switch_to.frame(ele1)
        self.driver.find_element('xpath','/html/body/div[2]/div/form[1]/div[1]/div[1]/button').click()  #点击新建文件
        sleep(1)
        self.driver.switch_to.default_content()   #跳到最外层
        ele2 = self.driver.find_element('xpath', '/html/body/div[1]/div/table/tbody/tr[2]/td[2]/div/table/tbody/tr[2]/td/div/iframe')   #进去新建文件名称层
        self.driver.switch_to.frame(ele2)
        self.driver.find_element('id', 'name').send_keys('ZZH')
        self.driver.find_element('id','button_save').click()

    def tearDown(self) -> None:
        self.driver.close()
if __name__ == '__main__':
    unittest.main()